package com.smartboot.plus.enums;


public enum BrokerNodeTypeEnum {
	CORE_NODE("core", "核心节点"),
	WORKER_NODE("worker", "工作节点");

	private String desc;

	private String code;

	BrokerNodeTypeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static BrokerNodeTypeEnum getByCode(String code) {
		for (BrokerNodeTypeEnum statueEnum : values()) {
			if (statueEnum.code.equals(code))
				return statueEnum;
		}
		throw new IllegalArgumentException("invalid code:" + code);
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return this.desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
